package javacafe.action.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.popup.PopupDTO;
import javacafe.serviceimple.PopupServiceImple;

public class PopupDeleteAction implements Action {
	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		ActionForward actfoward = new ActionForward();
		PopupServiceImple service = PopupServiceImple.getInstance();
		
		PopupDTO dto = new PopupDTO();
		int key= Integer.parseInt(request.getParameter("popno"));
		
		dto.setPu_no(key);
		boolean isS=service.deletePopup(dto);
		request.setAttribute("isS", isS);
		System.out.println(dto);
		actfoward.setUrl("deletepopup");
		return actfoward;
	}
}
